-
Notifications
You must be signed in to change notification settings - Fork 112
fix: /ok-to-test /retest pipelineruns should not be created if last sha successful #2048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: /ok-to-test /retest pipelineruns should not be created if last sha successful #2048
Conversation
fa2a595
to
72e4aca
Compare
/cancel |
579fd77
to
7508871
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
pkg/pipelineascode/pipelineascode.go:196
- [nitpick] Consider renaming the variable 'existingPRs' (later in the block) to 'existingRuns' or similar to more clearly indicate that it represents a collection of PipelineRun objects.
labelSelector := fmt.Sprintf("%s=%s", keys.SHA, formatting.CleanValueKubernetes(p.event.SHA))
/retest |
8f5c0ab
to
b44e208
Compare
cc @chmouel seems like the provider e2e tests are not running :/ wanted to test them, not sure what's up |
cc @zakisk |
60e1716
to
3554d83
Compare
…ipelineruns when executing /ok-to-test or /retest gitops commands, check whether the last pipelinerun created for the same SHA was successful. If the run was successful, skip new pipelinerun creation - Add checkForExistingSuccessfulPipelineRun logic to prevent creating duplicate PipelineRuns when /retest or /ok-to-test commands are used and a successful PipelineRun already exists for the same SHA - Fix cancel-in-progress flow by short-circuiting PullRequestClosed events to avoid interference with matching logic - Ensure /retest <pipelinerun-name> commands always create new PipelineRuns as explicitly requested by users - Add GetOriginalPipelineRunName helper function to eliminate duplicate logic across test files for finding PipelineRun names - Fix multiple tests that incorrectly used plain /retest expecting multiple PipelineRuns: now use /retest <name> for forced reruns - Update max-keep-runs tests to use specific PipelineRun names for proper testing of cleanup functionality - Fix timing issues in tests by adding proper waits for Repository CRD updates
3554d83
to
7a65309
Compare
fe82231
to
95d7ede
Compare
Changes
Add checkForExistingSuccessfulPipelineRun logic to prevent creating duplicate
PipelineRuns when /retest or /ok-to-test commands are used and a
successful PipelineRun already exists for the same SHA
Fix cancel-in-progress flow by short-circuiting PullRequestClosed events
to avoid interference with matching logic
Ensure /retest commands always create new PipelineRuns
as explicitly requested by users
Add GetOriginalPipelineRunName helper function to eliminate duplicate
logic across test files for finding PipelineRun names
Fix multiple tests that incorrectly used plain /retest expecting multiple
PipelineRuns: now use /retest for forced reruns
Update max-keep-runs tests to use specific PipelineRun names for proper
testing of cleanup functionality
Fix timing issues in tests by adding proper waits for Repository CRD updates
fixes #1959
Submitter Checklist
📝 Ensure your commit message is clear and informative. Refer to the How to write a git commit message guide. Include the commit message in the PR body rather than linking to an external site (e.g., Jira ticket).
♽ Run make test lint before submitting a PR to avoid unnecessary CI processing. Consider installing pre-commit and running pre-commit install in the repository root for an efficient workflow.
✨ We use linters to maintain clean and consistent code. Run make lint before submitting a PR. Some linters offer a --fix mode, executable with make fix-linters (ensure markdownlint and golangci-lint are installed).
📖 Document any user-facing features or changes in behavior.
🧪 While 100% coverage isn't required, we encourage unit tests for code changes where possible.
🎁 If feasible, add an end-to-end test. See README for details.
🔎 Address any CI test flakiness before merging, or provide a valid reason to bypass it (e.g., token rate limitations).
If adding a provider feature, fill in the following details:
(update the provider documentation accordingly)